1 : <?php
2 : /*--------------------------------------------------------------------------+
3 : This file is part of eStudy.
4 : courses/classes/class.participant.inc.php
5 : - Modulgruppe: Veranstaltung
6 : - Beschreibung: Datenstruktur zum Ablegen persönlicher Daten eines
7 : Veranstaltungsteilnehmers.
8 : - Version: 0.1, 21/12/03
9 : - Autor(en): Timo Fuchs <timo.fuchs@mni.fh-giessen.de>
10 : +---------------------------------------------------------------------------+
11 : This program is free software; you can redistribute it and/or
12 : modify it under the terms of the GNU General Public License
13 : as published by the Free Software Foundation; either version 2
14 : of the License, or any later version.
15 : +---------------------------------------------------------------------------+
16 : This program is distributed in the hope that it will be useful,
17 : but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : GNU General Public License for more details.
20 : You should have received a copy of the GNU General Public License
21 : along with this program; if not, write to the Free Software
22 : Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 : +--------------------------------------------------------------------------*/
24 :
25 : /**
26 : * In dieser Datei wird die Klasse Participant implementiert.
27 : *
28 : * @package eStudy.Courses
29 : * @author Timo Fuchs <timo.fuchs@mni.fh-giessen.de>
30 : * @version 0.1, 21/12/03
31 : */
32 :
33 : /**
34 : * Klasse zum Speichern von Teilnehmerdaten.
35 : *
36 : * @package eStudy.Courses
37 : * @author Timo Fuchs <timo.fuchs@mni.fh-giessen.de>
38 : * @version 0.1, 21/12/03
39 : */
40 1 : class Participant {
41 :
42 : /**
43 : * Rolle, die der Teilnehmer in der Veranstaltung einnimmt.
44 : * Kann die Werte "teacher","assistent","student","wait" oder "unknown" haben.
45 : *
46 : * @access public
47 : * @var string
48 : */
49 : var $role;
50 :
51 : /**
52 : * Userid des Teilnehmers.
53 : *
54 : * @access public
55 : * @var integer
56 : */
57 : var $userid;
58 :
59 : /**
60 : * Kurzname des Teilnehmers.
61 : *
62 : * @access public
63 : * @var string
64 : */
65 : var $shortname;
66 :
67 : /**
68 : * Vorname des Teilnehmers.
69 : *
70 : * @access public
71 : * @var string
72 : */
73 : var $firstname;
74 :
75 : /**
76 : * Nachname des Teilnehmers.
77 : *
78 : * @access public
79 : * @var string
80 : */
81 : var $lastname;
82 :
83 : /**
84 : * E-Mail-Adresse des Teilnehmers.
85 : *
86 : * @access public
87 : * @var string
88 : */
89 : var $email;
90 :
91 : /**
92 : * Konstruktor.
93 : *
94 : * @param $userid Userid des Teilnehmers.
95 : * @param $shortname Kurzname des Teilnehmers.
96 : * @param $firstname Vorname des Teilnehmers.
97 : * @param $lastname Nachname des Teilnehmers.
98 : * @param $email E-Mail-Adresse des Teilnehmers.
99 : * @param $role Rolle des Teilnehmers in der Veranstaltung.
100 : * $role darf folgende Werte haben :
101 : * "teacher","assistent","student","wait"
102 : * Default-Wert ist "none".
103 : * @return integer 1, falls Objekt fehlerfrei erzeugt wurde.
104 : * 0, falls fehlerhafte Parameter uebergeben wurden.
105 : */
106 : function Participant($userid, $shortname, $firstname, $lastname, $email, $role = "none") {
107 0 : $this->userid = $userid;
108 0 : $this->shortname = $shortname;
109 0 : $this->firstname = $firstname;
110 0 : $this->lastname = $lastname;
111 0 : $this->email = $email;
112 0 : if($role=="teacher" || $role=="assistent" || $role=="student" || $role=="wait") {
113 0 : $this->role = $role;
114 0 : } elseif($role == "none") {
115 0 : $this->role = "unknown";
116 0 : } else {
117 0 : $this->role = "unknown";
118 0 : return 0;
119 : }
120 :
121 0 : return 1;
122 : }
123 : }
|